<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工序物料审核（点击审核查询工序物料明细）</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.css" rel="stylesheet">
</head>
<body>
<div style="color: #0e9aef;margin: 20px;">您正在做的业务是：生产管理--工序物料设计--工序物料设计单审核</div>
<div class="container" id="process_details_inquiry_div">
    <div style="text-align: right">
        <button class="btn btn-default" onclick="javascript:history.back()">返回</button>
    </div>
    <div class="panel panel-default" style="margin-top: 10px;">
        <div class="page-heading">
            <div class="panel-title" style="margin-top: 20px;">
                <h2 style="text-align: center;">工序物料设计单</h2>
            </div>
        </div>
        <div class="panel-body">
            <form class="form-horizontal">
                <div class="form-group" style="text-align: center;">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">工序单编号：</label>
                        <div class="col-md-4">
                            <input type="text" class="form-control" style="border: none; background-color: white;"
                                   readonly
                                   name="designId" id="designId">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">工序名称：</label>
                        <div class="col-md-4">
                            <input type="text" class="form-control" style="border: none; background-color: white;"
                                   readonly
                                   name="procedureName" id="procedureName">
                        </div>
                    </div>
                </div>
                <div class="form-group" style="text-align: center;">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">登记人：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" style="border: none; background-color: white"
                                   readonly name="register" id="register">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">登记时间：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control"
                                   style="border: none; background-color: white;"
                                   readonly name="registerTime" id="registerTime">
                        </div>
                    </div>
                </div>
                <!--     工序物料明细表格信息       -->
                <table class="table table-bordered table-striped" data-toggle="table"
                       id="process_details_inquiry_tab">
                    <thead>
                    <tr>
                        <th data-field="detailsNumber">序号</th>
                        <th data-field="productName">物料名称</th>
                        <th data-field="productId">物料编号</th>
                        <th data-field="productDescribe">描述</th>
                        <th data-field="amount">本工序数量</th>
                        <th data-field="amountUnit">单位</th>
                        <th data-field="costPrice">单价（元）</th>
                        <th data-field="subtotal">小计（元）</th>
                    </tr>
                    </thead>
                </table>
                <input type="hidden" name="procedureId" id="procedureId">
            </form>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>

<script>
    $(function () {
        let procedureId = localStorage.getItem("procedureId")
        let productId = localStorage.getItem("productId")

        $.post("/manufacture/process/getProductIdQueryId", {"id": productId}, function (res) {
            $("#process_details_inquiry_div #register").val(res.register)
            $("#process_details_inquiry_div #designId").val(res.designId)
            $("#process_details_inquiry_div #registerTime").val(formater(res.registerTime))
        })
        $.post("/manufacture/process/getIdQueryProcess", {"id": procedureId}, function (res) {
            $("#process_details_inquiry_div #procedureName").val(res.procedureName)
            $("#process_details_inquiry_div #procedureId").val(res.procedureId)

        })

        setTimeout(function (){
          $.post("/manufacture/process/operationItemInquiry",{"productId":productId,"procedureId":$("#process_details_inquiry_div #procedureId").val()},
          function (res){
             for (let i=0;i<res.length;i++){
                 $("#process_details_inquiry_div #process_details_inquiry_tab").bootstrapTable("append",res[i])
             }
          })
        },100)
    })
</script>
</body>
</html>